package com.hllxd.hism.star.basic.service.constant.alarm;

/**
 * @description 计算类型枚举
 * @auhtor wuguangxi
 * @date 2022/1/4 17:12
 **/
public enum OperateTypeEnum {
    UP("up", "上升"),
    DOWN("down", "下降");


    private final String code;

    private final String name;

    OperateTypeEnum(String code, String name){
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static OperateTypeEnum getByCode(String code){
        for(OperateTypeEnum operateTypeEnum : OperateTypeEnum.values()){
            if(operateTypeEnum.getCode().equals(code)){
                return operateTypeEnum;
            }
        }
        return null;
    }
}
